<template>
	<view class="f-f-c p20">
		<u-navbar
		:autoBack="true" bgColor="#fff"
		leftIconColor='#000'
		:titleStyle="{ color: '#000'}"
		 title="提现记录" rightText='' :border="false" :placeholder="true">
			 
		</u-navbar>
		<view class="">
			
			<view class="m20 p20 b-s b-rd f-f-c p-s">
				<view class="f-s-b b-b pb20 f28 mb20" 
				v-for="item,index in datalist" :key="index" 
				@click="navTo('/pagesA/user/drawDetails?id=' + item.id)">
					<view class="f-f-c ">
						<span  class="f1 f f24" >
							<image class="mr10" style="width: 40rpx;" :src="accountType[item.accountType-1].img" mode="widthFix"></image>
							 <span>提现到{{accountType[item.accountType-1].name}}</span>
						</span>
						<span class="mt20 c6">{{item.account}}</span>
					</view>
					<view class="f-f-c ">
						<span class="c3 fb">+{{item.amount}}</span>
						<span class="mt20"  >{{item.status |drawType}}</span>
					</view>
					
					
				</view>
			</view>
			
			
			
		</view>
	
		
	</view>
</template>


<script>
	 export default {
		data() {
			return {
				datalist:[],
				pageNum:1,
				ismore:true,
				accountType:[
					{name:'支付宝',img:'/static/zfb.png'},
					{name:'微信',img:'/static/wx.png'},
					{name:'银行卡',img:'/static/card.png'}
				]
				
			}
		},
		onReachBottom() {
			
			if(this.ismore){
				this.pageNum ++
				this.getList()
			}else{
				 this.$api.msg('到底了')
			}
		},
		onReady() {
			
		},
		onLoad(){
			
		},
		onShow() {
			if(uni.getStorageSync('payType')){
				this.payType = uni.getStorageSync('payType')
			}
			this.pageNum = 1
			this.getList()
			// uni.setStorageSync('userInfo', res.data)
		},
		methods: {
			toDraw(){
				uni.setStorageSync('payType', this.payType)
				uni.navigateBack({delta:1})
			},
			getList(){
				let that = this
				this.$api.request('get', 'app/withdrawRecord/list',
				    {
				    pageNum:that.pageNum,
					pageSize:20,
					}
				).then(res => {
				  // console.log(res.rows)
				  if(res.rows.length<20){
					  that.ismore = false
				  }
				  if(that.pageNum == 1){
					   that.datalist = res.rows
				  }else{
					  that.datalist = [...that.datalist,...res.rows]
				  }
				 
				}).catch(err => {
				  this.$api.msg('请求失败，请稍后再试')
				})
			}
		}
	}
</script>

<style lang='scss'>
	page,
	.content {
		min-height: 50%;
		background-color: #f8f8f8;
	}

	.btn{
		width: 100%;
		height: 68rpx;
		background: #1AC388;
		border-radius: 34rpx 34rpx 34rpx 34rpx;
		opacity: 1;
		border: 2rpx solid var(--theme);
		text-align: center;
		line-height: 68rpx;
		color:#fff;
	}
	.btn2{
		width: 100%;
		height: 68rpx;
		background: rgba(26,195,136,0);
		border-radius: 34rpx 34rpx 34rpx 34rpx;
		opacity: 1;
		border: 2rpx solid var(--theme);
		text-align: center;
		line-height: 68rpx;
		color: var(--theme);
	}
	.placeholderClass{
		text-align: right;
	}
    .type1{
		width: 106rpx;
		height: 40rpx;
		background: rgba(26, 195, 136, 0.13);
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		text-align: center;
		font-size: 28rpx;
		font-weight: 400;
		color: #1AC388;
	}
	.type2{
		width: 106rpx;
		height: 40rpx;
		background: rgba(7, 117, 255, 0.13);
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		text-align: center;
		font-size: 28rpx;
		font-weight: 400;
		color: #0775FF;
	}
	.type3{
		width: 106rpx;
		height: 40rpx;
		background: rgba(255, 7, 7, 0.13);
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		text-align: center;
		font-size: 28rpx;
		font-weight: 400;
		color: #FF0707;
	}
</style>
